"✅ 自动补全插件-------------------------------------------------------
"✅ ale
let g:ale_set_highlights = 0

"自定义error和warning图标
let g:ale_sign_error = '✗'
let g:ale_sign_warning = '⚡'

"在vim自带的状态栏中整合ale
let g:ale_statusline_format = ['✗ %d', '⚡ %d', '✔ OK']

"显示Linter名称,出错或警告等相关信息
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'

"打开文件时不进行检查
let g:ale_lint_on_enter = 0

"普通模式下，ep前往上一个错误或警告，en前往下一个错误或警告
nmap <Leader>ep <Plug>(ale_previous_wrap)
nmap <Leader>en <Plug>(ale_next_wrap)
"触发/关闭语法检查
nmap <Leader>s :ALEToggle<CR>
"查看错误或警告的详细信息
nmap <Leader>e :ALEDetail<CR>
"语法检查
let g:ale_linters = {
"\'c++': ['clang'],
"\'c': ['clang'],
\'python': ['pylint'],
\}



"✅ UltiSnips
"插入模式触发UltiSnips的代码块补全
let g:UltiSnipsExpandTrigger="<C-z>"

"弹出可用列表
let g:UltiSnipsListSnippets="<C-i>"

"<C-f>跳转的到下一个代码块可编辑区
let g:UltiSnipsJumpForwardTrigger="<C-f>"

"<C-b>跳转到上一个代码块可编辑区
let g:UltiSnipsJumpBackwardTrigger="<C-b>"


"⚠️ nerdcommenter
" 注释分隔符后是否需要加空格
let g:NERDSpaceDelims = 0

" Use compact syntax for prettified multi-line comments
let g:NERDCompactSexyComs = 1

" Align line-wise comment delimiters flush left instead of following code indentation
let g:NERDDefaultAlign = 'left'

" Set a language to use its alternate delimiters by default
let g:NERDAltDelims_python = 1

" 自定义注释分隔符
let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } }

" Allow commenting and inverting empty lines (useful when commenting a region)
let g:NERDCommentEmptyLines = 1

" Enable trimming of trailing whitespace when uncommenting
let g:NERDTrimTrailingWhitespace = 1

" Enable NERDCommenterToggle to check all selected lines is commented or not 
let g:NERDToggleCheckAllLines = 1